home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / Vr299set.pxl < prev    next >
Text File  |  2000-12-23  |  13KB  |  538 lines

  1. {    Filename    : vr299set.pxl
  2.      Purpose    : Video color and aspect ratio setup for PCs
  3.     Version    : 1.2    RELEASE
  4.     Date        : 16-feb-1995
  5.     Author        : S.Dibbs, VYSOR Integration Inc
  6.  
  7.     Version    : 4.0    RELEASE
  8.     Date        : 30-may-1996
  9.     Author        : S.Dibbs, VYSOR Integration Inc
  10.  
  11.     Version    : 4.4    RELEASE
  12.     Date        : 30-aug-1998
  13.     Author        : S.Dibbs, VYSOR Integration Inc
  14.  
  15. ------------------------------------------------------------------------}
  16.  
  17. Initialize:
  18.     WinGetActive(Current$)
  19.     GetScreenCaps(BITSPIXEL,BitsPerPixel)
  20.     GetScreenCaps(HORZRES,X_Pixels)
  21.     GetScreenCaps(VERTRES,Y_Pixels)
  22.  
  23.     If BitsPerPixel = 8 Then Title$ = "Monitor Setup: 8-bit Colour Scale v5.0"
  24.     If BitsPerPixel = 15 Then Title$ = "Monitor Setup: 15-bit Colour Scale v5.0"
  25.     If BitsPerPixel = 16 Then Title$ = "Monitor Setup: 16-bit Colour Scale v5.0"
  26.     If BitsPerPixel = 24 Then Title$ = "Monitor Setup: 24-bit Colour Scale v5.0"
  27.     If BitsPerPixel = 32 Then Title$ = "Monitor Setup: 32-bit Colour Scale v5.0"
  28.     WinTitle(Current$,Title$)
  29.     WinLocate(Title$,0,0,X_Pixels,Y_Pixels,Res)
  30.     UseBackground(TRANSPARENT,0,0,0)
  31.     DrawBackGround
  32.     UseCoordinates(PIXEL)
  33.     DirGet(SourceDir$)
  34.     Draw_All_Grids = 0
  35.     Square$ = SourceDir$ + "\square.bmp"
  36.  
  37.     InfoMenu(REMOVE)
  38.     WaitInput(100)
  39.     SetMenu("E&xit",Run_Leave,
  40.         ENDPOPUP,
  41.         "&Colour Wedge",Wedge,
  42.         ENDPOPUP,
  43.         "&Geometric Pattern",Geom,
  44.         ENDPOPUP,
  45.         "&Draw Grids",IGNORE,
  46.         "Grid &1",Grid,
  47.         "Grid &2",Grid2,
  48.         "Grid &3", Grid3,
  49.         "Draw &All",All_Grids,
  50.         ENDPOPUP,
  51.         "&Help",IGNORE,
  52.         "Colour Wedge",Help_Wedge,
  53.         "Geometric Pattern",Help_Pattern,
  54.         "Grids",Help_Grids,
  55.         SEPARATOR,
  56.         "&About",About,
  57.         ENDPOPUP)
  58.  
  59.  
  60. Wait_for_Input:
  61.     WaitInput()
  62.  
  63. Invert:
  64.     InvertRectangle(cx1,cy1,cx2,cy2)
  65.     Goto Wait_for_Input
  66.  
  67. Wedge:
  68.     DrawBackground
  69.     SetMouse()
  70.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  71.     SetRightMouse(cx1,cy1,cx2,cy2,Invert,X,Y)
  72.     Red = 0
  73.     Green = 0
  74.     Blue = 0
  75.     X1 = 1    X2 = 32
  76.     Y1 = 11    Y2 = 94
  77.     UsePen(SOLID,2,255,255,255)
  78.     UseBrush(NULL,0,0,0)
  79.     DrawRectangle(0,10,1023,96)        {Gray}
  80.     DrawRectangle(0,110,1023,196)    {Red}
  81.     DrawRectangle(0,210,1023,296)    {Green}
  82.     DrawRectangle(0,320,1023,396)    {Blue}
  83.     DrawRectangle(0,410,1023,496)    {Yellow}
  84.     DrawRectangle(0,510,1023,596)    {Magenta}
  85.     DrawRectangle(0,610,1023,696)    {Cyan}
  86.     
  87. GrayLoop:
  88.     If X1 = 1025 Then Goto EndGrayLoop
  89.     UsePen(NULL,1,Red,Green,Blue)
  90.     UseBrush(SOLID,Red,Green,Blue)
  91.     DrawRectangle(X1,Y1,X2,Y2)
  92.     X1 = X1 + 32 
  93.     X2 = X2 + 32
  94.     If Red < 7 Then Red = Red + 7
  95.     If Green < 7 Then Green = Green + 7
  96.     If Blue < 7 Then Blue = Blue + 7
  97.     If Red >= 7 Then Red = Red + 8
  98.     If Green >= 7 Then Green = Green + 8
  99.     If Blue >= 7 Then Blue = Blue + 8
  100.     Goto GrayLoop
  101. EndGrayLoop:    
  102.  
  103.     Red = 0
  104.     Green = 0
  105.     Blue = 0
  106.     X1 = 1    X2 = 32
  107.     Y1 = 111    Y2 = 194
  108. RedLoop:
  109.     If X1 = 1025 Then Goto EndRedLoop
  110.     UsePen(NULL,1,Red,Green,Blue)
  111.     UseBrush(SOLID,Red,Green,Blue)
  112.     DrawRectangle(X1,Y1,X2,Y2)
  113.     X1 = X1 + 32  X2 = X2 + 32
  114.     If Red < 7 Then Red = Red + 7
  115.     If Red >= 7 Then Red = Red + 8
  116.     Goto RedLoop
  117. EndRedLoop:
  118.     Red = 0
  119.     Green = 0
  120.     Blue = 0
  121.     X1 = 1    X2 = 32
  122.     Y1 = 211    Y2 = 294
  123. GreenLoop:
  124.     If X1 = 1025 Then Goto EndGreenLoop
  125.     UsePen(NULL,1,Red,Green,Blue)
  126.     UseBrush(SOLID,Red,Green,Blue)
  127.     DrawRectangle(X1,Y1,X2,Y2)
  128.     X1 = X1 + 32  X2 = X2 + 32
  129.     If Green < 7 Then Green = Green + 7
  130.     If Green >= 7 Then Green = Green + 8
  131.     Goto GreenLoop
  132. EndGreenLoop:
  133.  
  134.     Red = 0
  135.     Green = 0
  136.     Blue = 0
  137.     X1 = 1    X2 = 32
  138.     Y1 = 321    Y2 = 394
  139. BlueLoop:
  140.     If X1 = 1025 Then Goto EndBlueLoop
  141.     UsePen(NULL,1,Red,Green,Blue)
  142.     UseBrush(SOLID,Red,Green,Blue)
  143.     DrawRectangle(X1,Y1,X2,Y2)
  144.     X1 = X1 + 32  X2 = X2 + 32
  145.     If Blue < 7 Then Blue = Blue + 7
  146.     If Blue >= 7 Then Blue = Blue + 8
  147.     Goto BlueLoop
  148. EndBlueLoop:
  149.  
  150.     Red = 0
  151.     Green = 0
  152.     Blue = 0
  153.     X1 = 1    X2 = 32
  154.     Y1 = 411    Y2 = 494
  155. YellowLoop:
  156.     If X1 = 1025 Then Goto EndYellowLoop
  157.     UsePen(NULL,1,Red,Green,Blue)
  158.     UseBrush(SOLID,Red,Green,Blue)
  159.     DrawRectangle(X1,Y1,X2,Y2)
  160.     X1 = X1 + 32  X2 = X2 + 32
  161.     If Red < 7 Then Red = Red + 7
  162.     If Green < 7 Then Green = Green + 7
  163.     If Red >= 7 Then Red = Red + 8
  164.     If Green >= 7 Then Green = Green + 8
  165.     Goto YellowLoop
  166. EndYellowLoop:
  167.  
  168.     Red = 0
  169.     Green = 0
  170.     Blue = 0
  171.     X1 = 1    X2 = 32
  172.     Y1 = 511    Y2 = 594
  173. MagentaLoop:
  174.     If X1 = 1025 Then Goto EndMagentaLoop
  175.     UsePen(NULL,1,Red,Green,Blue)
  176.     UseBrush(SOLID,Red,Green,Blue)
  177.     DrawRectangle(X1,Y1,X2,Y2)
  178.     X1 = X1 + 32  X2 = X2 + 32
  179.     If Red < 7 Then Red = Red + 7
  180.     If Blue < 7 Then Blue = Blue + 7
  181.     If Red >= 7 Then Red = Red + 8
  182.     If Blue >= 7 Then Blue = Blue + 8
  183.     Goto MagentaLoop
  184. EndMagentaLoop:
  185.  
  186.     Red = 0
  187.     Green = 0
  188.     Blue = 0
  189.     X1 = 1    X2 = 32
  190.     Y1 = 611    Y2 = 694
  191. CyanLoop:
  192.     If X1 = 1025 Then Goto EndCyanLoop
  193.     UsePen(NULL,1,Red,Green,Blue)
  194.     UseBrush(SOLID,Red,Green,Blue)
  195.     DrawRectangle(X1,Y1,X2,Y2)
  196.     X1 = X1 + 32  X2 = X2 + 32
  197.     If Green < 7 Then Green = Green + 7
  198.     If Blue < 7 Then Blue = Blue + 7
  199.     If Green >= 7 Then Green = Green + 8
  200.     If Blue >= 7 Then Blue = Blue + 8
  201.     Goto CyanLoop
  202. EndCyanLoop:
  203.     Goto Wait_for_Input
  204.  
  205.  
  206.  
  207.  
  208. GetXY:
  209.     Str(X,X$) Str(Y,Y$)
  210.     Co_ords$ = "X = " + X$ 
  211.     Co_ords$ = Co_ords$ + "   Y = "
  212.     Co_ords$ = Co_ords$ + Y$
  213.     MessageBox(OK,1,INFORMATION,Co_ords$,"Mouse Co-ordinates",Res)
  214.     Goto Wait_for_input
  215.  
  216.  
  217. All_Grids:
  218.     Draw_All_Grids = 1
  219. Grid:
  220.     DrawBackGround
  221.     SetMouse()
  222.     Size$ = "33"
  223.     If Draw_All_Grids = 1 Then Goto Grid_a
  224.     TextBox("Range is 1 - 64","Enter Grid Spacing",Size$,Btn)
  225.     If Btn = 2 Then Goto Wait_for_Input
  226. Grid_a:
  227.     Val(Size$,GridSize,Res)
  228.     If Res = 0 Then Goto Grid
  229.     If GridSize > 64 Then Goto Grid
  230.     UsePen(SOLID,1,255,255,255)
  231.     X1 = 0 X2 = X_Pixels
  232.     Y1 = 0 Y2 = Y_Pixels
  233. GridLoopX:
  234.     DrawLine(X1,Y1,X2,Y1)
  235.     Y1 = Y1 + GridSize
  236.     If Y1 < Y_Pixels Then Goto GridLoopX
  237.     Y1 = 0     Y2 = Y_Pixels
  238. GridLoopY:
  239.     DrawLine(X1,Y1,X1,Y2)
  240.     X1 = X1 + GridSize
  241.     If X1 < X_Pixels Then Goto GridLoopY
  242.     
  243.     If Draw_All_Grids = 1 Then Goto Grid2
  244.     Goto Wait_for_Input
  245.  
  246.  
  247. Grid2:
  248.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  249.     SetRightMouse(cx1,cy1,cx2,cy2,Invert,X,Y)
  250.     SetMouse()
  251.     X1 = 0 X2 = X_Pixels
  252.     Y1 = 0 Y2 = Y_Pixels
  253.     UseBrush(NULL,0,0,0)
  254.     UsePen(SOLID,1,255,255,255)    
  255.     DrawRectangle(X1,Y1,X2,Y2)    
  256.     FileExist("square.bmp",Res)
  257.     If Res = 0 then Gosub SData
  258.     If Res = 1 then Gosub Bitmaps
  259.     UseBrush(SOLID,0,0,0)
  260.     DrawRectangle(203,178,813,529)
  261.     DrawLine(204,295,812,295)
  262.     DrawLine(204,412,812,412)
  263. InitRed:
  264.     Red = 0
  265.     Green = 0
  266.     Blue = 0
  267.     X1 = 204     X2 = 212
  268.     Y1 = 180    Y2 = 294
  269. RedScale:
  270.     If X1 >= 810 then Goto EndRed    
  271.     UsePen(NULL,1, Red, Green, Blue)
  272.     UseBrush(SOLID,Red,Green,Blue)
  273.     DrawRectangle(X1,Y1,X2,Y2)
  274.     X1 = X1 + 7    X2 = X2 + 7
  275.     Red = Red + 3
  276.     If Red > 255 Then Red = 255
  277.     Goto RedScale
  278. EndRed:
  279. InitGreen:
  280.     Red = 0
  281.     Green = 0
  282.     Blue = 0
  283.     X1 = 204     X2 = 212
  284.     Y1 = 296    Y2 = 411
  285. GreenScale:
  286.     If X1 >= 810 then Goto EndGreen    
  287.     UsePen(NULL,1, Red, Green, Blue)
  288.     UseBrush(SOLID,Red,Green,Blue)
  289.     DrawRectangle(X1,Y1,X2,Y2)
  290.     X1 = X1 + 7        X2 = X2 + 7
  291.     Green = Green + 3    
  292.     If Green > 255 Then Green = 255
  293.     Goto GreenScale
  294. EndGreen:
  295. InitBlue:
  296.     Red = 0
  297.     Green = 0
  298.     Blue = 0
  299.     X1 = 204     X2 = 212
  300.     Y1 = 413    Y2 = 528
  301. BlueScale:
  302.     If X1 >= 810 then Goto EndBlue    
  303.     UsePen(NULL,1, Red, Green, Blue)
  304.     UseBrush(SOLID,Red,Green,Blue)
  305.     DrawRectangle(X1,Y1,X2,Y2)
  306.     X1 = X1 + 7        X2 = X2 + 7
  307.     Blue = Blue + 3    
  308.     If Blue > 255 Then Blue = 255
  309.     Goto BlueScale
  310. EndBlue:
  311.     If Draw_All_Grids = 1 Then Goto Grid3
  312.  
  313.     UseBrush(NULL,0,0,0)
  314.     UsePen(SOLID,1,255,255,255)    
  315.     DrawRectangle(203,178,813,529)    
  316.  
  317.     Goto Wait_For_Input
  318.  
  319.  
  320. Grid3:
  321.     SetMouse()
  322.     UseBrush(NULL,0,0,0)
  323.     UsePen(SOLID,1,255,255,255)
  324.     DrawRectangle(203,178,813,529)
  325.     DrawLine(204,295,812,295)
  326.     DrawLine(204,412,812,412)
  327. InitCyan:
  328.     Red = 0
  329.     Green = 0
  330.     Blue = 0
  331.     X1 = 803     X2 = 812
  332.     Y1 = 237    Y2 = 294
  333.  
  334. CyanScale:
  335.     If X1 <= 202 then Goto EndCyan    
  336.     UsePen(NULL,1, Red, Green, Blue)
  337.     UseBrush(SOLID,Red,Green,Blue)
  338.     DrawRectangle(X1,Y1,X2,Y2)
  339.     If X1 >= 794 Then X1 = X1 - 16
  340.     X1 = X1 - 8        X2 = X2 - 8
  341.     Green = Green + 3
  342.     Blue = Blue + 3    
  343.     Goto CyanScale
  344. EndCyan:
  345. InitMagenta:
  346.     Red = 0
  347.     Green = 0
  348.     Blue = 0
  349.     X1 = 803     X2 = 812
  350.     Y1 = 353    Y2 = 411
  351. MagentaScale:
  352.     If X1 <= 202 then Goto EndMagenta    
  353.     UsePen(NULL,1, Red, Green, Blue)
  354.     UseBrush(SOLID,Red,Green,Blue)
  355.     DrawRectangle(X1,Y1,X2,Y2)
  356.     If X1 >= 794 then X1 = X1 - 16
  357.     X1 = X1 - 8        X2 = X2 - 8
  358.     Red = Red + 3    
  359.     Blue = Blue + 3
  360.     Goto MagentaScale
  361. EndMagenta:
  362. InitYellow:
  363.     Red = 0
  364.     Green = 0
  365.     Blue = 0
  366.     X1 = 803     X2 = 812
  367.     Y1 = 470    Y2 = 528
  368. YellowScale:
  369.     If X1 <= 202 then Goto EndYellow    
  370.     UsePen(NULL,1, Red, Green, Blue)
  371.     UseBrush(SOLID,Red,Green,Blue)
  372.     DrawRectangle(X1,Y1,X2,Y2)
  373.     If X1 >= 794 then X1 = X1 - 16
  374.     X1 = X1 - 8        X2 = X2 - 8
  375.     Red = Red + 3    
  376.     Green = Green + 3
  377.     Goto YellowScale
  378. EndYellow:
  379.     If Draw_All_Grids = 1 Then Goto Geom
  380.     Goto Wait_For_Input    
  381.  
  382. Geom:
  383.     UseBrush(NULL,0,0,0)
  384.     UsePen(SOLID,2,255,255,0)
  385.     eX1 = 195  eY1 = 20  
  386.     eX2 = X_Pixels - 195    
  387.     diameter = eX2 - eX1
  388.     eY2 = eY1 + diameter
  389.     DrawEllipse(eX1,eY1,eX2,eY2)
  390.  
  391.     eX1 = 255  eY1 = 80  
  392.     eX2 = X_Pixels - 255    
  393.     diameter = eX2 - eX1
  394.     eY2 = eY1 + diameter
  395.     UsePen(SOLID,2,255,0,255)
  396.     DrawEllipse(eX1,eY1,eX2,eY2)
  397.  
  398.     eX1 = 315  eY1 = 140  
  399.     eX2 = X_Pixels - 315    
  400.     diameter = eX2 - eX1
  401.     eY2 = eY1 + diameter
  402.     UsePen(SOLID,2,0,255,255)
  403.     DrawEllipse(eX1,eY1,eX2,eY2)
  404.  
  405.     WinGetClientRect("",cx1,cy1,cx2,cy2)
  406.     SetMouse(cx1,cy1,cx2,cy2,GetXY,X,Y)
  407.  
  408.     Draw_All_Grids = 0
  409.  
  410.     Goto Wait_for_Input
  411.  
  412.  
  413. Locate:
  414.     Goto Wait_for_Input
  415.  
  416. Maximize:
  417.     WinShow(Title$,MAXIMIZE,Res)
  418.     Goto Wait_for_Input
  419.  
  420. Help_Wedge:
  421.     MessageBox(OK,1,INFORMATION,
  422. "The Color Wedges start from Black on the left and
  423. end up with the primary colors (Red-Green-blue) and 
  424. their opposites (Yellow-Megenta-Cyan) on the right.
  425.  
  426. There is also a greyscale wedge shown, starting from 
  427. Black on the left and ending with White on the right.
  428. The monitor colour balance should be adjusted so that
  429. there is no colour shading in the greyscale.
  430.  
  431. Click on the right mouse to invert the colors in the
  432. client rectangle.",
  433.         "Colour Wedge",Res)
  434.     Goto Wait_For_Input
  435.  
  436. Help_Pattern:
  437.     MessageBox(OK,1,INFORMATION,
  438. "This pattern consists of 3 interlaced circles.
  439. These serve as reference for the vertical and 
  440. horizontal display size of your monitor. Adjust
  441. your monitor so that the circle is round, rather
  442. than an ellipse.
  443.  
  444. It also shows you the coordinates of any pixel
  445. you point at on the screen using the left mouse.
  446.  
  447. Click on the right mouse to invert the colors in the
  448. client rectangle.",
  449.     "Pattern and Coordinates",Res)
  450.     Goto Wait_For_Input
  451.  
  452. Help_Grids:
  453.     MessageBox(OK,1,INFORMATION,
  454. "Grid 1:
  455. Draws a square grid on the screen consisting
  456. of any choosen size, with the default value of 33.
  457.  
  458. Grid 2:
  459. Draws 4 bull's eye patterns, each near one of the 
  460. corners f the screen. There are also 3 wedges using
  461. the primary colors (Red-Green-Blue) shown in
  462. the middle of the screen inside a rectangle.
  463.  
  464. This can help you adjust the overall display of
  465. your monitor (colors and position) if needed.
  466.  
  467. Grid 3:
  468. This grid is an addition to the previous
  469. one in that it prints 3 more wedges using
  470. the opposites (Yellow-Magenta-Cyan) of the
  471. primary colors.
  472.  
  473. Draw All:
  474. This last option first displays Grid 1 with the
  475. default value of 33 being used. It next adds
  476. Grid 2 and 3 to the display and finishes it
  477. with the Pattern/coordinates utility.
  478.  
  479. Click on the right mouse to invert the colors in the
  480. client rectangle.",
  481.     "All the Grids",Res)
  482.     Goto Wait_For_Input
  483.  
  484. About:
  485.     AboutUser("About Monitor Setup",  "Windows 95 / NT  4.0 Monitor Setup Utility.",
  486.     "This application helps you set up the geometry and color balance of your monitor.")
  487.  
  488.     Goto Wait_For_Input
  489.  
  490. Run_Leave:
  491.     End
  492.  
  493. Bitmaps:
  494.     DrawBitMap(50,25,Square$)
  495.     DrawBitMap(808,25,Square$)
  496.     DrawBitMap(50,528,Square$)
  497.     DrawBitMap(808,528,Square$)
  498.     Return
  499. SData:
  500.     SX1 = 50    SY1 = 25
  501.     Gosub Squares
  502.     SX1 = 817    SY1 = 25
  503.     Gosub Squares
  504.     SX1 = 50    SY1 = 532
  505.     Gosub Squares
  506.     SX1 = 817    SY1 = 532
  507.     Gosub Squares
  508.     Return
  509. Squares:
  510.     UseBrush(NULL,0,0,0)
  511.     UsePen(SOLID,1,255,255,255)
  512.     SX2 = SX1 + 150    SY2 = SY1 + 150
  513.     DrawRectangle(SX1,SY1,SX2,SY2)
  514.     SX1 = SX1 + 1    SY1 = SY1 + 1
  515.     SX2 = SX2 - 1    SY2 = SY2 - 1
  516.     DrawEllipse(SX1,SY1,SX2,SY2) 
  517.     SX1 = SX1 + 20    SY1 = SY1 + 20
  518.     SX2 = SX2 - 20    SY2 = SY2 - 20
  519.     DrawEllipse(SX1,SY1,SX2,SY2)
  520.     SX1 = SX1 + 20    SY1 = SY1 + 20
  521.     SX2 = SX2 - 20    SY2 = SY2 - 20
  522.     DrawEllipse(SX1,SY1,SX2,SY2)
  523.     SX1 = SX1 + 20    SY1 = SY1 + 20
  524.     SX2 = SX2 - 20    SY2 = SY2 - 20
  525.     DrawEllipse(SX1,SY1,SX2,SY2)
  526.     SX1 = SX1 + 5    SY1 = SY1 + 5
  527.     UseBrush(SOLID,255,255,0)
  528.     DrawFlood(SX1,SY1,255,255,255)
  529.     SX1 = SX1 -15    SY1 = SY1 - 15
  530.     UseBrush(SOLID,0,255,0)
  531.     DrawFlood(SX1, SY1,255,255,255)
  532.     SX1 = SX1 - 10    SY1 = SY1 - 10
  533.     UseBrush(SOLID,0,0,255)
  534.     DrawFlood(SX1,SY1,255,255,255)
  535.     SX1 = SX1 - 10    SY1 = SY1 - 10
  536.     USeBrush(SOLID,255,0,0)
  537.     DrawFlood(SX1,SY1,255,255,255)
  538.     Return